<template>
	<view class="content">
		<view class="title">
			<text></text>
			<view> 路线 {{pathAttractionList.name}}</view>
		</view>
		<view class="pathList">
			<view class="pathList-item" v-for="(item,index) in pathAttractionList.pathAttractionList" :key="index">
				<image
					:src="item.attractionImages? $u.fileBaseUrl+item.attractionImages.split(',')[0] :'../../static/images/index/zwtp.png' "
					mode="widthFix">
				</image>
				<view>
					{{item.attractionName}}
				</view>
			</view>
		</view>
		<view class="pace">
			<button>路线价格{{pathAttractionList.price ?pathAttractionList.price : '0'}}元</button>
			<button @click="goNextStep()">选择摄影/车辆/套餐</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pathAttractionList: {}
			};
		},
		onLoad(options) {
			this.getpathlist(options.id)
		},
		methods: {
			async getpathlist(id) {
				let res = await this.$u.api.getpathlist({
					id: id
				})
				if (res.code == 200) {
					this.pathAttractionList = res.data
				}
			},
			goNextStep() {
				uni.navigateTo({
					url: `/packagesIndex/pages/photography/photography?id=${this.pathAttractionList.id}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background-color: #fff;
		padding-bottom: 50rpx;
		box-sizing: border-box;
		font-size: 28rpx;

		.title {
			margin: 0 10rpx;
			padding: 20rpx;
			box-sizing: border-box;
			display: flex;
			align-items: center;

			text {
				width: 10rpx;
				height: 30rpx;
				display: block;
				background-color: $overall-color;
				margin-right: 15rpx;
			}

			view {
				font-weight: 800;
			}
		}

		.pathList {
			margin: 0 30rpx;

			.pathList-item {
				position: relative;

				image {
					width: 100%;
					margin: 20rpx 0;
					border-radius: 20rpx;
				}

				view {
					width: 100%;
					position: absolute;
					bottom: 20rpx;
					background-color: #fff;
					border-radius: 20rpx;
					box-shadow: 10rpx 10rpx 15rpx #EFEFEF;
					padding: 20rpx;
					box-sizing: border-box;
				}
			}
		}

		.pace {
			width: 100%;
			display: flex;
			justify-content: space-around;
			align-items: center;
			background-color: #fff !important;
			padding: 20rpx 20rpx 50rpx 20rpx;
			box-sizing: border-box;
			position: fixed;
			bottom: 0rpx;

			button {
				flex: 1;

				&:nth-child(1) {
					color: #000000;
					background-color: #fff;
					text-align: center;
					padding: 20rpx 30rpx;
					box-sizing: border-box;
					margin-right: 20rpx;
				}

				&:nth-child(2) {
					color: #ffffff;
					background-color: $overall-color;
					text-align: center;
					padding: 20rpx 30rpx;
					box-sizing: border-box;
					// margin-right: 20rpx;
				}
			}
		}
	}
</style>